package top.z.template.parse.ast.expression;

import top.z.template.Context;
import top.z.template.Template;
import top.z.template.parse.Ast.Expression;
import top.z.template.parse.Span;

import java.io.IOException;
import java.io.OutputStream;

/**
 * Integer
 */
public class IntegerLiteral extends Expression {

    private final Integer value;

    public IntegerLiteral(Span span) {
        super(span);
        this.value = Integer.parseInt(span.getText());
    }

    public Integer getValue() {
        return value;
    }

    @Override
    public Object evaluate(Template template, Context context, OutputStream out) throws IOException {
        return value;
    }

}
